<?php
/**
 * Created by PhpStorm.
 * User: Edik
 * Date: 2016/3/2
 * Time: 15:22
 */

namespace Home\Controller;


use Admin\Model\ServerModel;
use Admin\Model\ServerTypeModel;

class ServerController extends BaseController
{
    function index(){
        $servertype = new ServerTypeModel();
        $model = new ServerModel();
        $id = I('get.id',1);

        $this->assign("st", $servertype->select());
        $this->assign("server", $model->where('server_type_id = '.$id)->select());
        $this->assign("id", $id);
        $this->assign("menu", "server");
        $this->display();
    }

    function xq(){
        $servertype = new ServerTypeModel();
        $model = new ServerModel();
        $id = I('get.id',1);
        $aid = I('get.aid',1);

        $this->assign("st", $servertype->select());
        $this->assign("server", $model->where('id = '.$aid)->find());
        $this->assign("id", $id);
        $this->assign("menu", "server");
        $this->display();
    }

}